//
// Created by v on 24-5-13.
//

#ifndef JKLIBS_CM_DISCOVERY_SERVICE_H
#define JKLIBS_CM_DISCOVERY_SERVICE_H

#include "cm_broadcast_function.h"
#include "cm_thread_task_manager.h"
#include "cm_protocol_convert_impl_general.h"

class CMDiscoveryService : public CMThreadRunImpl
{
  public:
    CMDiscoveryService();
    virtual ~CMDiscoveryService();

    int start(int port = 8899, int rport = 8898);
    int stop();

  protected:

    int run() override;
    bool runDone() override;

  private:

    bool exited;
    CMBroadcastFunction broadcastFunctionSend;
    CMBroadcastFunction broadcastFunctionRecv;
    CMProtocolConvertInterface *protocolConvertInterface;
};

#endif // JKLIBS_CM_DISCOVERY_SERVICE_H
